package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.GiveAnAlarmDao;
import cn.topevery.garden.entity.po.GiveAnAlarm;
import cn.topevery.garden.entity.query.GiveAnAlarmQuery;
import cn.topevery.garden.entity.vo.GiveAnAlarmVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 人车报警记录表
 *
 * @author code-generate
 * @date 2022-01-18
 */
@Service
public class GiveAnAlarmLogic extends BaseLogic<GiveAnAlarm> {
    @Autowired
    GiveAnAlarmDao giveAnAlarmDao;

    @Override
    public BaseEntityDao<GiveAnAlarm, Integer> getDao() {
        return giveAnAlarmDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<GiveAnAlarmVO> listPage(GiveAnAlarmQuery query) {
        return giveAnAlarmDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        giveAnAlarmDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param giveAnAlarm 实体
     */
    public void saveOrUpdate(String userId, GiveAnAlarm giveAnAlarm){
        giveAnAlarmDao.saveOrUpdate(userId,giveAnAlarm);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public GiveAnAlarm getEntityByColumn(String key, String value) {
        return giveAnAlarmDao.getEntityByColumn(key, value);
    }

    /**
     *  报警自动生成
     * @param
     * @return
     * @创建人 dong.zou
     * @创建时间 2022/1/18
     */
    public Boolean synAlerm() {
        return giveAnAlarmDao.synAlerm();
    }

}
